Skip to main content

5.1.1 Create and withdraw digital currency to any wallet

#Brief description: Withdraw digital currency to the wallet's withdrawal business interface, allowing users to transfer usdt to the specified wallet address (market exchange rate)

Request parameters
Parameter nameTypeRequiredParameter meaningParameter description
keystringYesMerchant keyapiKey
localOrderIdstringYesMerchant platform local order numberMerchant platform generates unique order number locally
localUserIdstringNoMerchant platform local user IDMerchant platform local user ID
amountnumberYesAmountOrder Amount
networkstringYesMainnetMainnet (currently only supports TRON, BSC, POLYGON, ETHEREUM)
addressstringYesWithdrawal AddressWithdrawal Address
notifyUrlstringNoCallback addressAfter the order is successfully placed, the merchant's address will be notified by the API callback request (for callback details, please refer to Document 3)
currencystringYesCurrencyOrder Currency
userCurrencystringYesThe currency actually received by the userThe currency actually received by the user
successRedirectUrlstringNoAddressAutomatically jump to the address after success
isBlockchainbooleanNoWhether to return blockchain information (default false)When true, the callback request will carry the transaction information on the order chain
expireSecondLongNoExpiration timestamp (seconds)
signstringYesSignatureSee Signature Algorithm for details
Request json sample
{
"key": "weOfDMRpUAvAeOs5",
"localOrderId": "TestOTM0625ROB017",
"notifyUrl": "http://www.baidu.com/728-TestOTM0625ROB01",
"amount": 20,
"network": "TRON",
"currency": "CNY",
"userCurrency": "USDT",
"successRedirectUrl": "http://www.baidu.com",
"address": "TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"isBlockchain": true,
"sign": "834e924f7846fe3a65b53e6680c8e53a"
}

Response json example

{
"code": 0,
"success": true,
"message": null,
"data": {

"orderId": 473220978729221,
"localUserId": null,
"localOrderId": "TestOTM0625ROB017",
"orderType": "WITHDRAW",
"orderBizType": "WITHDRAW_ANY_DIGITAL_WALLET",
"targetType": "EXTERNAL",
"network": "TRON",
"address": "TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"currency": "CNY",
"userCurrency": "USDT",
"amount": "20",
"userAmount": "2.994723",
"userReceivableAmount": "2.994723",
"rate": "6.67841204",
"rateExpression": "1USDT≈6.6784CNY"
}
}
Response data parameter description
Parameter nameTypeParameter meaningRemarks
orderIdstringOrder ID
localUserIdstringMerchant local user ID
localOrderIdstringMerchant local order number
orderTypeenumOrder TypePAYMENT:支付订单 | WITHDRAW:提款订单
orderBizTypeenumOrder business typeorderBizType type description is as follows
targetTypeenumTarget typetargetType type description is as follows
networkstringMainnet type
addressstringAddressOn-chain payment address
currencystringOrder currency
userCurrencystringArrival currency
amountstringOrder amount
userAmountstringAmount paid by the user
userReceivableAmountstringUser receivable amount
ratestringExchange rate
rateExpressionstringExchange rate expression

orderBizType type description:

  1. PAYMENT_WALLET_SCAN MINPAY wallet scan code payment
  2. PAYMENT_TRANSFER digital currency binding address direct deposit
  3. PAYMENT_ANY_DIGITAL_SCAN Scan the QR code to pay any amount of digital currency
  4. WITHDRAW_WALLET withdraw money to MINPAY wallet
  5. WITHDRAW_ANY_DIGITAL_WALLET Withdraw digital currency to any wallet
  6. PAYMENT_FIXED_DIGITAL_SCAN digital currency limited amount scan code payment
  7. BATCH_PAY batch payment

targetType type description:

  1. INTERNAL internal address
  2. EXTERNAL external address
  3. USER user abstract address

Callback returns json data

By default, all callback parameters participate in signature verification. For details of callback parameters, please see callback ]

Callback data
{
"amount":"20",
"bizType":"WITHDRAW_ANY_DIGITAL_WALLET",
"blockchain":{
"network":"TRON",
"receiverAddress":"TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"senderAddress":"TE35TrUfHjbGEBsVS6zVXdHS8HxXCWwC2y",
"txId":"c5503ecf1f0979d5bc7a7e16c3cad20290449913ab47a7e18dfca6ba6f2725fa"
},
"currency":"CNY",
"localOrderId":"TestOTM0625ROB017",
"merchantActualAmount":"57.32",
"merchantCurrency":"CNY",
"merchantId":302992856974,
"merchantPaidAmount":"20",
"notifyTime":1772259079786,
"orderCreateTime":1772259032870,
"orderId":"473220978729221",
"status":"SUCCESS",
"type":"WITHDRAW",
"userAmount":"2.994723",
"userCurrency":"USDT",
"userMinerFee":"0",
"userReceivableAmount":"2.994723",
"sign":"742e64d684648c32c7ad33cf8d5604e2",
"key":"9yUreYgTRtit39Dy"
}

When you receive the callback notification, please directly return the string success after the processing is completed, indicating that the message has been successfully received and processed. After the system receives the success response, it will no longer send the callback repeatedly. If the expected response is not received (success is not returned or an exception is returned), the system will resend the callback notification according to the stepped retry mechanism, retrying up to 14 times. The current retry intervals are: 15s, 15s, 30s,180s, 600s, 1200s, 1800s, 1800s, 1800s,3600s,10800s,10800s,21600s, 21600s